/******************************************************************************
 * File: : Roomplan.h
 * Autor : Thomas Pfeiffer
 * Descr.: Header for the Class Roomplan
 *****************************************************************************/
#ifndef ROOMPLAN_H
#define ROOMPLAN_H

#include <iostream>
#include <string>
#include <list>

#include "Object.h"
#include "Room.h"

// Roomplan allows you to manage a list of rooms
// You can add rooms and connect them with a door.
class Roomplan : public Object {
public:
  // The constructor. A Roomplan needs to know the dimension
  // for the rooms it contains
	Roomplan(size_t h, size_t w) : mHeight(h), mWidth(w) {};

  // get the Height for each room
	size_t getHeight() { return mHeight; };
  
  // get the width for each room
	size_t getWidth() { return mWidth; };

  // Add a new room to the list. (The room is being copied)
  // Returns an index which can be used to access the room later
	size_t addRoom(Room const & newroom);
  
  // Return a previously added room. The room is specified by
  // the index returned by addRoom
	Room* getRoom( size_t index );

  // Connects the room with the index "index" to the room
  // with the next index. If there is no next index, it does nothing
	void connectToNext( size_t index );
  
  // Print all of the rooms in the list
	void Print() const;

private:
  // Private copy constructor so that a roomplan can't be copied.
	Roomplan(const Roomplan& rp) {};

  // Some typedefs
	typedef std::list<Room> TRooms;
	typedef std::list<Room>::iterator TRoomIterator;
	typedef std::list<Room>::const_iterator TRoomConstIterator;

  // The list which contains the rooms
	TRooms mRooms;

	size_t mWidth;
	size_t mHeight;
};

#endif